<template>
  <div class="">
    <h4>这是子组件2</h4>
    <h1>来自vuex的数据{{ $store.state.msg }}</h1>
    <h5>接收到的来自child1的数据是{{ msg }}</h5>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "",
    };
  },
  mounted() {
    this.$bus.$on("getdata", (val) => {
      console.log(val);
      this.msg = val;
    });
  },
  methods: {},
  components: {},
};
</script>

<style lang="scss"></style>
